/**
 * 
 */
package com.antilia.infomaresme.data.dataobjects;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.UniqueConstraint;

/**
 * A news referring to an item.
 * 
 * @author Ernesto
 */
@Entity
@Table(uniqueConstraints = {@UniqueConstraint(columnNames={"item_fk","date"})})
public class ItemNews extends DomainObject {

	private static final long serialVersionUID = 1L;

	@Id
	@GeneratedValue
	private Long id;
	
	private String title;
	
	@ManyToOne
	@JoinColumn(name="item_fk")
	private Item item;
		
	private Date date;
			
	@Column(length=2000)
	private String text;
	
	private VisibilityStatus status;
	
	/**
	 * 
	 */
	public ItemNews() {
	}

	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public Item getItem() {
		return item;
	}

	public void setItem(Item item) {
		this.item = item;
	}

	public Date getDate() {
		return date;
	}

	public void setDate(Date date) {
		this.date = date;
	}

	public String getText() {
		return text;
	}

	public void setText(String text) {
		this.text = text;
	}

	public VisibilityStatus getStatus() {
		return status;
	}

	public void setStatus(VisibilityStatus status) {
		this.status = status;
	}

	public String getTitle() {
		return title;
	}

	public void setTitle(String title) {
		this.title = title;
	}

}
